﻿Imports USA411
Public Class HS2_Test

    Dim hs As USA411.HomeSeer2Engine


    Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
        hs = New USA411.HomeSeer2Engine(txtServer.Text, txtUserID.Text, txtPassword.Text)
        pnlTestControls.Enabled = True
        cbX10.SelectedIndex = 3
        cbSDS.SelectedIndex = 3
        cbSDV.SelectedIndex = 3

        UpdateLog()
    End Sub


    Private Sub UpdateLog()
        txtLog.Text = hs.GetLog
    End Sub

    Private Sub btnSetDevice_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnXX10.Click
        hs.ExecuteX10(txtDevCode1.Text, cbX10.Text, 50)
        UpdateLog()
    End Sub

    Private Sub btnSDS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSDS.Click
        hs.SetDeviceStatus(txtDevCode2.Text, cbSDS.SelectedIndex)
        UpdateLog()
    End Sub

    Private Sub btnSDV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSDV.Click
        hs.SetDeviceValue(txtDevCode3.Text, cbSDV.SelectedIndex)
        UpdateLog()
    End Sub

    Private Sub btnRunScript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRunEventt.Click
        hs.RunEvent(txtEvent.Text)
        UpdateLog()
    End Sub
End Class